using Zhaoxi.Zhihu.Core.Common;
using Zhaoxi.Zhihu.SharedKerel.Domain;

namespace Zhaoxi.Zhihu.Core.QuestionAggregate.Entites;

public class Question:AuditWithUserEntity,IAggregateRoot
{
    public string Title { get; set; } = null!;
    
    public string? Description { get; set; }
    
    public int ViewCount { get; private set; }
    
    public int FollowCount { get; internal set; }

    public ICollection<Answer> Answers { get; set; } = new List<Answer>();

    public void AddViewCount(int count)
    {
        ViewCount += count;
    }

    public int SubView()
    {
        ViewCount -= 1;
        return ViewCount;
    }
}